#ifndef CITYBUSINFI_H
#define CITYBUSINFI_H

#include <vector>
#include <string>
#include <map>
#include "StringDic.h"

class CBusLineInfo;
class CStationInfo;


using namespace std;
class CCityBusInfo
{
public:
	CCityBusInfo(void);
	~CCityBusInfo(void);
	void						Init(const char *pszCityName,unsigned short BusLineCount,unsigned short StationsCount);
	inline const char*			GetName()const{ return m_pszCityName;}
	inline const void			SetName(const char *pszName){ 
		memcpy_s(m_pszCityName,MAX_CITYNAME_LENGTH,pszName,MAX_CITYNAME_LENGTH);
	}
	void						AddBusLine(CBusLineInfo	*pBusLineInfo);
	void						AddStationInfo(CStationInfo *pStationInfo);
	inline CStationInfo *		GetStationInfo(int nIndex)
	{
		if( nIndex < m_vecAllBusLineInfo.size())
			return NULL;
		return m_vecAllStationInfo[nIndex];
	}
	inline CBusLineInfo *		GetBusLineInfo(int nIndex)
	{
		if( nIndex >= m_vecAllBusLineInfo.size())
			return NULL;
		return m_vecAllBusLineInfo[nIndex];
	}
public:
	inline	CStringDic&			GetStringDic()
	{
		return m_StrDic;
	}
private:
	void						Release();
	char						m_pszCityName[MAX_CITYNAME_LENGTH];
	vector<CBusLineInfo*>		m_vecAllBusLineInfo;
	vector<CStationInfo*>		m_vecAllStationInfo;
	CStringDic					m_StrDic;
};

#endif